Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
A code that identifies the voucher.
"2CpRCE2c"
Query Parameters
A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returnee by voucher validation, or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud.
Body
Provide the redemption context in the request body.
- Discount Code
- Gift Card
- Loyalty Card
Request body schema for redeeming a voucher using POST v1/vouchers/{code}/redemption
.
Redeem a discount code.
Schema model for session
lock object. The session object is required to establish a session between multiple parallel validation and redemption requests. If you only send the type
parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a <!-- [validation session](..docs/guides/campaign_recipes/Locking-Validation-Session.md) -->validation session.
Customer's information. You can pass the unique customer ID that was assigned by Voucherify.
- Customer ID
- Customer Source ID
- Customer
Order information. You can pass the unique order ID that was assigned by Voucherify.
- Order ID
- Order Source ID
- Order Customer And Referrer Ids Objects
A set of key/value pairs that you can send in the request body to check against vouchers requiring redemption metadata validation rules to be satisfied. The validation runs against rules that are defined through the <!-- [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) -->Create Validation Rules endpoint or via the Dashboard; in the Advanced Rule Builder → Advanced → Redemption metadata satisfy or Basic Builder → Attributes match → REDEMPTION METADATA. Read more.
Configure parameters returned in the response.
Response
Returns a redemption object if the redeem operation succeeded.
- Redeem Voucher Response Body
- Redeem Voucher Response Body
- Redeem Voucher Response Body
Response body schema for POST v1/vouchers/{code}/redemption
.
This is an object representing an attempted or successful voucher redemption.
This is an object representing a redemption.
Redemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (quantity
). Each redemption is recorded in voucher/promotion's history (redemption_entries
). There is also an option to cancel a redemption. We call such operation a <!-- [redemption rollback](OpenAPI.json/paths/~1redemptions~1{redemptionId}~1rollback/post) -->redemption rollback.
Unique redemption ID.
"r_0bc92f81a6801f9bca"
The type of the object represented by the JSON. This object stores information about the redemption
.
Timestamp in ISO 8601 format indicating when the redemption occured.
"2022-10-03T12:24:58.008Z"
Unique customer ID of the redeeming customer.
"cust_i8t5Tt6eiKG5K79KQlJ0Vs64"
Hashed customer source ID.
"track_fxEMFiLowFHg=="
The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption.
Redemption result.
SUCCESS
, FAILURE
Defines the details of the order that is related to the redemption. This is an object representing an order with calculated discounts applied using the voucher code.
- Order object - Effect: Apply to order
- Order object - Effect: Apply to items
Defines the details of the channel through which the redemption was issued.
Defines the customer that is related to the redemption.
Defines the related object.
Related Object | Definition |
---|---|
voucher | Either a discount voucher, gift card, or loyalty card. |
voucher
Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
Defines the details of the voucher being redeemed. This is an object representing a voucher with categories and validation rules assignments. This is an object representing a voucher holder. This is an object representing a voucher.